<template>
  <div class="goodsdesc_container">
    <h3 class="title">{{ descList.title }}</h3>
    <div class="content" v-html="descList.content"></div>
  </div>
</template>

<script>
export default {
  name: 'goodsdesc',
  data() {
    return {
      id: this.$route.params.id,
      descList: []
    }
  },
  created() {
    this.$store.dispatch('getGoodsDesc', this.id).then(res => {
      if(res.data.code === 200) {
        res.data.list[0].content = 
          res.data.list[0].content.replace(/images/g, '/static/images')
        this.descList = res.data.list[0]
      }
    })
  }
}
</script>

<style lang="less" scoped>
  .goodsdesc_container {
    h3 {
      font-size: 16px;
      color: #226aff;
      text-align: center;
      border-bottom: 2px solid #ddd;
      padding: 15px 0;
    }
  }
</style>
